﻿using Lis.DTO;
using Lis.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lis.KISSFRSTDAL
{
    public class AppointmentDal:BaseDal<AppointmentDto>,IAppointmentDal
    {

        #region 01,根据读者卡号获取预约信息+IEnumerable<AppointmentDto> GetEntitiesByUserName(string UserName)
        /// <summary>
        /// 根据读者卡号获取预约信息
        /// </summary>
        /// <param name="UserName">读者卡号</param>
        /// <returns></returns>
        public IEnumerable<AppointmentDto> GetEntitiesByUserName(string UserName)
        {
            return DB.QueryEntities<AppointmentDto>("Lis.Appointment.Select.HoldList", new { DZTM=UserName});
        } 
        #endregion

        #region 02，分页查询+override IQueryable<AppointmentDto> GetPageEntities<S>(int pageSize, int pageIndex, out int total, bool isAsc, System.Linq.Expressions.Expression<Func<AppointmentDto, bool>> whereLambda, System.Linq.Expressions.Expression<Func<AppointmentDto, S>> orderByLambda)
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <typeparam name="S"></typeparam>
        /// <param name="pageSize">页大小</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="total">总数</param>
        /// <param name="isAsc">是否倒叙</param>
        /// <param name="whereLambda">查询lambda</param>
        /// <param name="orderByLambda">排序lambda</param>
        /// <returns></returns>
        public override IQueryable<AppointmentDto> GetPageEntities<S>(int pageSize, int pageIndex, out int total, bool isAsc, System.Linq.Expressions.Expression<Func<AppointmentDto, bool>> whereLambda, System.Linq.Expressions.Expression<Func<AppointmentDto, S>> orderByLambda)
        {
            throw new NotImplementedException();
        } 
        #endregion
    }
}
